import {AfterViewInit, Component, ContentChild, Input, OnInit, TemplateRef} from '@angular/core';
import {Location} from '@angular/common';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit, AfterViewInit {

  @ContentChild('leftRef') leftRef: TemplateRef<any>;
  @ContentChild('centerRef') centerRef: TemplateRef<any>;
  @ContentChild('rightRef') rightRef: TemplateRef<any>;

  @Input() title: string;

  constructor(
    private location: Location
  ) {
  }

  ngOnInit() {
  }

  ngAfterViewInit(): void {
  }

  back(): void {
    this.location.back();
  }

}
